package com.zjuee.base.dto.common.auth;

import com.zjuee.base.base.Converter;
import com.zjuee.base.bean.Pages;
import com.zjuee.base.model.common.auth.Org;
import com.zjuee.base.model.common.auth.User;
import lombok.*;
import org.springframework.beans.BeanUtils;

/**
 * Org DTO
 *
 * @author wu liang
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class OrgDto extends User implements Converter<Org, OrgDto> {

    private Pages page;

    @Override
    public void convertToDo(Org org) {
        BeanUtils.copyProperties(this, org);
    }

    @Override
    public OrgDto convert(Org org) {
        BeanUtils.copyProperties(org, this);
        return this;
    }
}